﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace HotelManager
{
    public partial class FrmHotelMain : Form
    {
        string type = null;
        string name = null;
        public FrmHotelMain(string name, string type)
        {
            InitializeComponent();
            this.type = type;
            this.name = name;
        }


        private void HotelManager_Load(object sender, EventArgs e)
        {
            lb1.Text = (25).ToString();
            lb2.Text = (BLL.CustomerBLL.BllSelectID()).ToString();
            lb3.Text = (BLL.CustomerBLL.BllSelectkong()).ToString();
            lb4.Text = (BLL.CustomerBLL.BllSelectyuding()).ToString();
            lb5.Text = (BLL.CustomerBLL.BllSelectting()).ToString();
            lb6.Text = (BLL.CustomerBLL.BllSelectmoney()).ToString();

            SqlDataReader dr = BLL.CustomerBLL.BllSelectAllType();
            while (dr.Read())
            {

            }
            SqlDataReader dr1 = BLL.CustomerBLL.BllSelectAllType1();
            while (dr1.Read())
            {

            }
            SqlDataReader dr2 = BLL.CustomerBLL.BllSelectAllType2();
            while (dr2.Read())
            {

            }
            SqlDataReader dr3 = BLL.CustomerBLL.BllSelectAllType3();
            while (dr3.Read())
            {

            }
            SqlDataReader dr4 = BLL.CustomerBLL.BllSelectAllType4();
            while (dr4.Read())
            {

            }
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            FrmHotelRegisting dlg = new FrmHotelRegisting();
            dlg.ShowDialog();
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            FrmHotelAdjusting dlg = new FrmHotelAdjusting();
            dlg.ShowDialog();
        }

        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            FrmHotelChecking dlg = new FrmHotelChecking();
            dlg.ShowDialog();
        }

        private void toolStripButtonRegister_Click(object sender, EventArgs e)
        {
            FrmHotelRegisting dlg = new FrmHotelRegisting();
            dlg.ShowDialog();
        }

        private void toolStripButtonAdjust_Click(object sender, EventArgs e)
        {
            FrmHotelAdjusting dlg = new FrmHotelAdjusting();
            dlg.ShowDialog();
        }

        private void toolStripButtonAccount_Click(object sender, EventArgs e)
        {
            FrmHotelAccouting dlg = new FrmHotelAccouting();
            dlg.ShowDialog();
        }

        private void toolStripButtonCheck_Click(object sender, EventArgs e)
        {
            FrmHotelChecking dlg = new FrmHotelChecking();
            dlg.ShowDialog();
        }

        private void 退出系统ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult drt = MessageBox.Show("你确定要退出吗？", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (drt == DialogResult.Yes)
            {
                //this.Close();
                Application.Exit();
            }
        }

        private void 修改管理员密码MToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (type == "经理")
            {
                FrmHotelbakePwd fhbp = new FrmHotelbakePwd();
                fhbp.Show();
            }
            else
            {
                MessageBox.Show("你没有权限");
            }
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            FrmHotelMembers dlg = new FrmHotelMembers();
            dlg.ShowDialog();
        }

        private void toolStripButtonAccounting_Click(object sender, EventArgs e)
        {
            FrmHotelAccouting dlg = new FrmHotelAccouting();
            dlg.ShowDialog();
        }

        private void FrmHotelMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void toolStripButtonAdjusting_Click(object sender, EventArgs e)
        {
            FrmHotelAdjusting adjustRoom = new FrmHotelAdjusting();
            adjustRoom.ShowDialog();
        }

        private void FrmHotelMain_Leave(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
